using StructureMap;
using mitasoft.Component.Services.Interfaces;
using mitasoft.Component.Services;
namespace mitasoft.Web
{
    public static class IoC
    {
        public static IContainer Initialize()
        {
            ObjectFactory.Initialize(x =>
                        {
                            x.Scan(scan =>
                                    {
                                        scan.TheCallingAssembly();
                                        scan.WithDefaultConventions();
                                    });

                            x.For<IBlogService>().HybridHttpOrThreadLocalScoped().Use<BlogService>();
                            x.For<ICommonService>().HybridHttpOrThreadLocalScoped().Use<CommonService>();

                        });
            return ObjectFactory.Container;
        }
    }
}